package com.gitee.wsl.doc.prosemirror.model.fragment.ext

import com.gitee.wsl.doc.prosemirror.model.fragment.Fragment
import com.gitee.wsl.doc.prosemirror.model.node.NodeType

fun Fragment.isInvalidMarks(type: NodeType, start: Int): Boolean {
    this.removeRange()
    for (i in start until childCount) {
        if (!type.allowsMarks(child(i).marks)) return true
    }
    return false
}